<template>
    <div>
        <el-bread></el-bread>
        <el-button type="primary" plain class="btn" @click="add">添加</el-button>
        <v-list @edit="edit"></v-list>
        <v-Dialog :isShow="isShow" :isAdd="isAdd" @close="close" ref="dialogRef"></v-Dialog>
        
    </div>
</template>
<script lang="ts" setup>
import vList from "./list.vue"
import vDialog from "./dialog.vue"
import {ref,reactive} from "vue"
let dialogRef =ref()

let isShow = ref(false)
let isAdd = ref(true)

let close = () =>{
    isShow.value = false
}
let add = () =>{
    isShow.value = true
    isAdd.value = true
}
let edit = (id:number)=>{
    isAdd.value = false
    isShow.value = true
    dialogRef.value.lookup(id)
    
}
</script>
<style lang="less">
  
 .btn{
    margin: 10px;
    margin-left: 0;
 }
</style>